package com.temp.controller.admin;

import com.temp.dto.SearchPaymentDTO;
import com.temp.entity.User;
import com.temp.result.Result;
import com.temp.service.PaymentOrderService;
import com.temp.utils.ShiroUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/admin/payment")
@Api(tags = "管理支付订单相关接口")
@Slf4j
@Validated
public class AdminPaymentOrderController {

    @Autowired
    private PaymentOrderService paymentOrderService;

    @PostMapping("/query")
    @ApiOperation("管理员查询订单信息")
    @RequiresPermissions("admin:payment:query")
    public Result getAllPaymentOrder(@RequestBody SearchPaymentDTO paymentDTO) {
        paymentDTO.formatParam();
        return Result.success(paymentOrderService.queryAllPaymentOrder(paymentDTO), "apiMsg.querySuccess");
    }
}
